import { ApiProperty } from '@nestjs/swagger';
import { IsEnum, IsNotEmpty } from 'class-validator';

export class GetWeatherDto {
  @ApiProperty({ description: '城市编码', example: '110101' })
  @IsNotEmpty({ message: '城市编码不能为空' })
  city: string;
  @ApiProperty({
    description:
      '气象类型: 可选值：base/all ,base:返回实况天气,all:返回预报天气',
    example: 'base',
  })
  @IsEnum(['base', 'all'])
  extensions: string;
  @ApiProperty({ description: '返回格式: 可选值：JSON,XML', example: 'JSON' })
  @IsEnum(['JSON', 'XML'])
  output: string;
}
